import sys
from PyQt5.QtWidgets import *
from d435 import D435
from ultralytics import YOLO
from arm import Rokae
from util_3d import *
from grab_win import GrabWindow
from controller import Controller
import lift
from task import Task
# from qt_material import apply_stylesheet

if __name__ == '__main__':
    # model
    model_path = r'./best.pt'
    model = YOLO(model_path)
    # camera
    camera = D435()
    camera.set_param_outer('./param_outer.txt')
    end_t_cam = halcon_pose_to_T(camera.out_param_halcon_type)
    inr = camera.color_intrinsics
    # arm
    arm = Rokae()
    arm.init()
    # lift
    lf = lift.Lift()

    app = QApplication(sys.argv)
    main_win = GrabWindow()
    control = Controller(main_win, camera, arm, model, lf)

    main_win.show()
    sys.exit(app.exec_())
